<?php
/*
 +----------------------------------------------------------------------
 + Title        : Snowflake 控制器
 + Author       : Randy_chen
 + Version      : V1.0.0.1
 + Initial-Time : 2022/2/26 19:19
 + Last-time    : 2022/2/26 19:19+ chen2
 + Desc         : Snowflake
 +----------------------------------------------------------------------
*/


namespace randy\tools\units;

use wantp\Snowflake\IdWorker;

class Snowflake
{
    /**
     * @throws \Exception
     */
    public static function get()
    {
        return $IdWorker = IdWorker::getIns()
                                   ->id();
    }

    public static function parse($id)
    {
        return $IdWorker = IdWorker::getIns()
                                   ->parse($id);
    }
}